<?php

namespace console\controllers;

use Yii;
use yii\console\Controller;

class JxdReviewController extends Controller
{
    public $number;

    public function options($actionID)
    {
        return ['number'];
    }

    public function optionAliases()
    {
        return ['n' => 'number'];
    }

    /**
     * @desc php ./yii jxd-review/create -n=99
     * @return void
     * @Date: 2024/11/6
     */
    public function actionCreate()
    {
        $number1 = $this->number;
        echo $number1 . PHP_EOL;
        exit;
    }

    static function sort_multi_field()
    {
        $arr = [
            [9, 8, 7, 6, 5, 3],
            [9, 8, 7, 6, 4, 1],
            [9, 8, 7, 5, 5, 2],
            [9, 8, 6, 6, 5, 3],
            [9, 7, 7, 6, 5, 4],
            [2, 8, 7, 6, 5, 4],
        ];

        $c1 = array_column($arr, 0);
        $c2 = array_column($arr, 1);
        $c3 = array_column($arr, 2);
        $c4 = array_column($arr, 3);
        $c5 = array_column($arr, 4);
        $c6 = array_column($arr, 5);

        array_multisort($c1, SORT_ASC,
            $c2, SORT_ASC,
            $c3, SORT_ASC,
            $c4, SORT_ASC,
            $c5, SORT_ASC,
            $c6, SORT_ASC,
            $arr
        );

        foreach ($arr as $v) {
            echo json_encode($v) . PHP_EOL;
        }
    }
}
